﻿using System;
using Group_Mail;
using NUnit.Framework;

namespace Group_Mail_UnitTest
{
    [TestFixture]
    public class TestManager
    {
        [Test]
        public void AddGroup()
        {
            var group = new Group { Name = "Test Group" };
            group.Id = Guid.NewGuid().ToString();
            
            var abc = new Recipient();
            abc.SetFieldValue("Email", "nguyen.dainghia@gmail.com");
            abc.SetFieldValue("FullName", "Nguyen Dai Nghia");

            var def = new Recipient();
            def.SetFieldValue("Email", "admin@mylifevn.com");
            def.SetFieldValue("FullName", "MyLifeVn");

            group.Recipients.Add(abc);
            group.Recipients.Add(def);

            Manager.AddGroup(group);
        }

        [Test]
        public void AddAccount()
        {
            var account = new Account();
            account.Id = Guid.NewGuid().ToString();
            account.FullName = "Nguyen dai nghia";
            account.Email = "nguyen.dainghia@gmail.com";
            Manager.AddAccount(account);
        }

        [Test]
        public void LoadAccounts()
        {
            Assert.AreEqual(2,Manager.Accounts.Count);
        }
    }
}